﻿
Imports DCM.DCM_IO
Imports System.Web
Imports DCM_Http
Imports System.Drawing
Imports DCM
Public Module GetDataFromServer
#Region "设置操作人信息"
    Public Sub SetSendRecordCaoZuoren(ByRef SendRecord As DCM_HttpListen_Record, Optional CaoZuoNeiRong As String = "")
        SendRecord.CaoZuoRen_ID = CaoZuoRen_ID
        SendRecord.CaoZuoRen = CaoZuoRen
        SendRecord.CaoZuoNeiRong = CaoZuoNeiRong
        SendRecord.ApplicationStartRndID = AppRndID
        SendRecord.ConnectApp = ConnectApp
        SendRecord.AppVersionNumber = AppVersionNumber
        SendRecord.CaoZuoRen_Mac = CaoZuoRen_MAC
        SendRecord.UserServerIPStyle = ServerIP_Style
    End Sub
#End Region
#Region "文件相关"

    Dim TBName_Log As String = "泵聊_发送文件"
    ''' <summary>
    ''' 返回发送文件的ID
    ''' </summary>
    ''' <param name="LocalFileName"></param>
    ''' <param name="cn_this"></param>
    ''' <param name="Server_Folder"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function GetServerFileIDAndSaveLog(LocalFileName As String, Server_Folder As String, cn_this As DCM_Http.DCM_CN, FLen As Long, SendDate As Date) As Integer
        Dim FF = DCM.Get_FileInfoFromFileName(LocalFileName)
        Dim Fs_NoPath As String = FF.文件名 & "." & FF.后缀名
        Return DCM_Control.SQL_Insert(TBName_Log, {"名称", "文件大小", "日期", "SendID", "操作人", "路径"},
                                                  {Fs_NoPath, CStr(FLen), DCM.ChangeDateTostring(SendDate), CStr(CaoZuoRen_ID), CaoZuoRen, Server_Folder}, cn_this)

    End Function
    Public Function GetTimerFromServerToStr() As String
        Return DCM.ChangeDateTostring(GetTimerFromServer())
    End Function
    Public Function GetTimerFromServer() As Date
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.GetTimerFromServer
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Return GetDataFromRecordFromSQLServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    End Function
    Public Function GetFileFromServerWithAbsoluteFilename(LocalFileName As String, ServerAbsoluteFileName As String, Optional F_重复项强制重命名 As Boolean = False, Optional F_重复项强制覆盖 As Boolean = True, Optional F_重复的占用文件加TMP下载 As Boolean = False,
                            Optional ShowProcessValue As ShowProcessValue = Nothing) As Boolean
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.GetFileFromServerWithAbsoluteFilename
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.ServerAbsoluteFileName.ToString) = ServerAbsoluteFileName
        Dim SendRecord As New DCM_HttpListen_Record
        'SendRecord.DCMHttp_Enum_RequestType = DCMHttp_Enum_RequestType
        'SendRecord.DCMHttp_Enum_DataBaseName = DCMHttp_Enum_DataBaseName
        'SendRecord.DCMHttp_Enum_ReturnDataType = DCMHttp_Enum_ReturnDataType
        'SendRecord.DCMHttp_Enum_ConnectStyle = DCMHttp_Enum_ConnectStyle
        'SendRecord.Message = SQLStr
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Dim FN = DCM.DCM_IO.Get_FileInfoFromFileName(ServerAbsoluteFileName)
        Return GetFileFromServerToFile(FF, LocalFileName, pq, SendRecord, ServerIP, ServerPort, YSFS, F_重复项强制重命名, F_重复项强制覆盖, F_重复的占用文件加TMP下载, Nothing, ShowProcessValue)
    End Function
    Public Function GetFileToBytesFromServerWithRelationFilename(ServerRelationFileName As String,
                                                                 Optional ShowProcessValue As ShowProcessValue = Nothing) As Byte()
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.GetFileFromServerWithAbsoluteFilename
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.ServerRelativeFileName.ToString) = ServerRelationFileName
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        '  Return GetFileFromServerToBytes(FF, pq, SendRecord, ServerIP, ServerPort, YSFS, _PB, Nothing, ShowProcessValue)
    End Function
    Public Function GetPDMFileToBytes(PDMFileCode As String,
                                      Optional ShowProcessValue As ShowProcessValue = Nothing) As Byte()
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.GetPDMFile
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.PDMFileCode.ToString) = PDMFileCode
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        '  Return GetFileFromServerToBytes(FF, pq, SendRecord, ServerIP, ServerPort, YSFS, _PB, Nothing, ShowProcessValue)
    End Function
    Public Function GetFileFromServerWithRelationFilename(LocalFileName As String,
                                                          ServerRelationFileName As String,
                                                          Optional F_重复项强制重命名 As Boolean = False,
                                                          Optional F_重复项强制覆盖 As Boolean = True,
                                                          Optional F_重复的占用文件加TMP下载 As Boolean = False,
                            Optional ShowProcessValue As ShowProcessValue = Nothing) As Boolean
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.GetFileFromServerWithRelativeFileName
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.ServerRelativeFileName.ToString) = ServerRelationFileName
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Dim FN = DCM.DCM_IO.Get_FileInfoFromFileName(ServerRelationFileName)
        '     Return GetFileFromServerToFile(FF, LocalFileName, pq, SendRecord, ServerIP, ServerPort, YSFS, _PB, F_重复项强制重命名, F_重复项强制覆盖, F_重复的占用文件加TMP下载, Nothing, ShowProcessValue)
    End Function
    Public Function GetFileFromServerWithURLMethod(LocalFileName As String,
                                                   URLMethod As Enum_URL_调用服务器方法,
                                                   Optional F_重复项强制重命名 As Boolean = False,
                                                          Optional F_重复项强制覆盖 As Boolean = True,
                                                          Optional F_重复的占用文件加TMP下载 As Boolean = False,
                            Optional ShowProcessValue As ShowProcessValue = Nothing) As Boolean
        Dim FF As Enum_URL_调用服务器方法 = URLMethod
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        'pq(Enum_URL_传入参数.ServerRelativeFileName.ToString) = ServerRelationFileName
        Dim SendRecord As New DCM_HttpListen_Record
        'SendRecord.DCMHttp_Enum_RequestType = DCMHttp_Enum_RequestType
        'SendRecord.DCMHttp_Enum_DataBaseName = DCMHttp_Enum_DataBaseName
        'SendRecord.DCMHttp_Enum_ReturnDataType = DCMHttp_Enum_ReturnDataType
        'SendRecord.DCMHttp_Enum_ConnectStyle = DCMHttp_Enum_ConnectStyle
        'SendRecord.Message = SQLStr
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        ' Dim FN = DCM.DCM_IO.Get_FileName_路径And名称And扩展名(ServerRelationFileName)
        '   Return GetFileFromServerToFile(FF, LocalFileName, pq, SendRecord, ServerIP, ServerPort, YSFS, _PB, F_重复项强制重命名, F_重复项强制覆盖, F_重复的占用文件加TMP下载, Nothing, ShowProcessValue)
    End Function
#Region "获取当前文件夹"
    Private TBName_FTP_当前文件夹 As String = "FTP_当前文件夹"
    Private Function GetServerSaveFolder(ServerFolder As String, MyStyle As DCM.Enum_过滤条件_FolderStyle, Cn_this As DCM_Http.DCM_CN,
                                         Optional UpdateCount As Integer = 1) As String
        Dim MaxFolder As Integer = 1000
        Dim MaxFile As Integer = 1000
        Dim sqlstr As String = "select * from " & TBName_FTP_当前文件夹 & " where style=" & MyStyle
        Dim f1 As Integer = 0, f2 As Integer = 0, f3 As Integer = 0, Count As Integer = 0

        Using DT As DataTable = DCM_Control.SQL_Get_DataTable(sqlstr, Cn_this)
            If IsNothing(DT) Then Throw New Exception("返回未实例化的Datatable")
            If DT.Rows.Count = 0 Then Throw New Exception("未找到Style=" & MyStyle & "的数据")
            f1 = CInt(DCM.CaseDBNullToString(DT.Rows(0)("文件夹1")))
            f2 = CInt(DCM.CaseDBNullToString(DT.Rows(0)("文件夹2")))
            f3 = CInt(DCM.CaseDBNullToString(DT.Rows(0)("文件夹3")))
            Count = CInt(DCM.CaseDBNullToString(DT.Rows(0)("文件数量")))
        End Using
        Count = Count + UpdateCount
        Dim Flag As Boolean = False
        If Count > MaxFile Then
            Count = 0
            f3 = f3 + 1
            Flag = True
            If f3 > MaxFolder Then
                f3 = 0
                f2 = f2 + 1
                Flag = True
                If f2 > MaxFolder Then
                    f2 = 0
                    f1 = f1 + 1
                    Flag = True
                End If
            End If
        End If
        Dim sqlstr_update As String = ""
        If Flag = True Then
            sqlstr_update = DCM.SQLSr_Update(TBName_FTP_当前文件夹, "文件夹1=" & f1 & ",文件夹2=" & f2 & ",文件夹3=" & f3 & ",文件数量=" & Count, "Style=" & MyStyle)
        Else
            sqlstr_update = DCM.SQLSr_Update(TBName_FTP_当前文件夹, "文件数量=" & Count, "Style=" & MyStyle)
        End If
        DCM_Control.SQL_Update(sqlstr_update, Cn_this)

        Return ServerFolder & "\1-" & f1 & "\2-" & f2 & "\3-" & f3
    End Function
#End Region
    ''' <summary>
    ''' 返回的文件名称改为服务器的文件名称,路径改为服务器的相对路径
    ''' </summary>
    ''' <param name="LocalFileName"></param>
    ''' <param name="Server_顶层Folder"></param>
    ''' <param name="MyStyle"></param>
    ''' <param name="SendDate"></param>
    ''' <param name="_PB"></param>
    ''' <param name="ShowProcessValue"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function SendFileToServerRelative_自动三层文件夹(LocalFileName As String, Server_顶层Folder As String,
                                                     MyStyle As DCM.Enum_过滤条件_FolderStyle,
                                                     SendDate As Date,
                                                     Optional ShowProcessValue As ShowProcessValue = Nothing) As DCM.Get_FileName_名称扩展名
        Using Cn_this = New DCM_Http.DCM_CN(DCM.DCMHttp_Enum_DataBaseName.CQPUMP_FTP_32, DCM.DCMHttp_Enum_ConnectStyle.DCM_HttpListenServer_DataBase)
            '文件大小 
            Dim FLen As Long = DCM.Get_FileSize(LocalFileName)
            '获取将要存储的服务器文件夹路径
            Dim ServerFolder_实际存储路径 As String = GetServerSaveFolder(Server_顶层Folder, MyStyle, Cn_this)
            '记录文件上传日志
            Dim ServerFileNameID = GetServerFileIDAndSaveLog(LocalFileName, ServerFolder_实际存储路径, Cn_this, FLen, SendDate)
            '开始上传文件
            Dim FN = DCM.Get_FileInfoFromFileName(LocalFileName)
            '修改返回值
            FN.路径 = ServerFolder_实际存储路径
            FN.文件大小 = FLen
            FN.文件名 = "ID=" & ServerFileNameID & "-" & FN.文件名
            '上传文件
            SendFileToServerWithRelativeFilename(LocalFileName,
                                                 DCM.ReplaceStr_单引号转下划线(ServerFolder_实际存储路径 & "\" & DCM.HeBing文件名称和后缀名(FN.文件名, FN.后缀名)),
                                                  ShowProcessValue)
            '将上传日志改为成功
            DCM_Control.SQL_Update(TBName_Log, {"是否成功"}, {"是"}, "ID=" & ServerFileNameID, Cn_this)

            Return FN
        End Using
    End Function
    Public Function SendFileToServerRelative_指定文件夹(LocalFileName As String, Server_Folder As String, SendDate As Date,
                                                       Optional ShowProcessValue As ShowProcessValue = Nothing) As Get_FileName_名称扩展名
        Using Cn_this = New DCM_Http.DCM_CN(DCM.DCMHttp_Enum_DataBaseName.CQPUMP_FTP_32, DCMHttp_Enum_ConnectStyle.DCM_HttpListenServer_DataBase)
            '文件大小 
            Dim FLen As Long = DCM.Get_FileSize(LocalFileName)
            '记录文件上传日志
            Dim ServerFileNameID = GetServerFileIDAndSaveLog(LocalFileName, Server_Folder, Cn_this, FLen, SendDate)
            '开始上传文件
            Dim FN = DCM.Get_FileInfoFromFileName(LocalFileName)
            Dim ServerFileNameNoPath As String = "ID=" & ServerFileNameID & "-" & FN.文件名
            SendFileToServerWithRelativeFilename(LocalFileName,
                                                 Server_Folder & "\" & ServerFileNameNoPath & "." & FN.后缀名,
                                                  ShowProcessValue)
            '将上传日志改为成功
            DCM_Control.SQL_Update(TBName_Log, {"是否成功"}, {"是"}, "ID=" & ServerFileNameID, Cn_this)
            '修改返回值
            FN.路径 = Server_Folder
            FN.文件大小 = FLen
            FN.文件名 = ServerFileNameNoPath
            Return FN
        End Using
    End Function
    Private Sub SendFileToServerWithRelativeFilename(LocalFileName As String, ServerRelativeFileName As String, Optional ShowProcessValue As ShowProcessValue = Nothing)
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.SendFileToServerWithRelativeFilename
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.ServerRelativeFileName.ToString) = ServerRelativeFileName
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        SendFileToServer(FF, LocalFileName, pq, SendRecord, ServerIP, ServerPort, YSFS, ShowProcessValue)
    End Sub

    Public Function SendFileToServerWithAbsoluteFilename(LocalFileName As String,
                                                         ServerAbsoluteFileName As String,
                                                         Optional ShowProcessValue As ShowProcessValue = Nothing) As String
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.SendFileToServerWithAbsoluteFilename
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.ServerAbsoluteFileName.ToString) = ServerAbsoluteFileName
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Return SendFileToServer(FF, LocalFileName, pq, SendRecord, ServerIP, ServerPort, YSFS, ShowProcessValue)
    End Function

    Public Function DeleteFileFromServer_Absolute(Str As String) As Boolean
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.DeleteFileFromServer_Absolute
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.ServerAbsoluteFileName.ToString) = Str
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Dim rs As String = DCM_Http.GetDataFromRecordFromSQLServer(FF, pq, SendRecord, ServerIP, ServerPort, Enum_CS_数据压缩方式.序列化压缩)
        Return True
    End Function
    Public Function DeleteFileFromServer_Relative(Str As String) As Boolean
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.DeleteFileFromServer_Relative
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.ServerRelativeFileName.ToString) = Str
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Dim rs As String = DCM_Http.GetDataFromRecordFromSQLServer(FF, pq, SendRecord, ServerIP, ServerPort, Enum_CS_数据压缩方式.序列化压缩)
        Return True
    End Function
    Public Function DeleteFolderFromServer_Absolute(Str As String) As Boolean
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.DeleteFolderFromServer_Absolute
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.ServerFolder_AbSolute.ToString) = Str
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Dim rs As String = DCM_Http.GetDataFromRecordFromSQLServer(FF, pq, SendRecord, ServerIP, ServerPort, Enum_CS_数据压缩方式.序列化压缩)
        Return True
    End Function
    Public Function DeleteFolderFromServer_Relative(Str As String) As Boolean
        Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.DeleteFolderFromServer_Relative
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        pq(Enum_URL_传入参数.ServerFolder_Relative.ToString) = Str
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.TimeOut = 30
        SendRecord.IDName = ""
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Dim rs As String = DCM_Http.GetDataFromRecordFromSQLServer(FF, pq, SendRecord, ServerIP, ServerPort, Enum_CS_数据压缩方式.序列化压缩)
        Return True
    End Function
#End Region
#Region "百度人工智能"
    'Public Function BadiDu_通用文字识别接口(img As Image) As String
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.API_BaiDu_GeneralBasic
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SendRecord.Data = img
    '    SetSendRecordCaoZuoren(SendRecord)
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
    'Public Function BadiDu_增值税发票识别接口(img As Image) As String
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.API_BaiDu_VatInvoice
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SendRecord.Data = img
    '    SetSendRecordCaoZuoren(SendRecord)
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
#End Region
#Region "其他接口"
    'Public Function Kingdee_BOS_WebApi_Client(方法 As K3Cloud_Fangfa, formid As String, datas() As String) As String
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.Kingdee_BOS_WebApi_Client
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Dim Data = New C_Record_K3 With {.FangFa = 方法, .formid = formid, .Data = datas}
    '    SendRecord.Data = Data
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
    'Public Function Kingdee_BOS_WebApi_Client_ReLoad() As String
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.Kingdee_BOS_WebApi_Client_ReLoad
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    '   Dim Data = New C_Record_K3 With {.FangFa = 方法, .formid = formid, .data = datas}
    '    ' SendRecord.Data = Data
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
    'Public Function GoogleTranslate(需要翻译的文字 As String, 原文语言类型简称 As String, 译文语言类型简称 As String) As String
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.GoogleTranslate
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    pq(Enum_URL_传入参数.Google_P.ToString) = HttpUtility.UrlEncode(需要翻译的文字)
    '    pq(Enum_URL_传入参数.Google_Language_From.ToString) = 原文语言类型简称
    '    pq(Enum_URL_传入参数.Google_Language_To.ToString) = 译文语言类型简称
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
    'Public Function TongBu_GongYiGongXu(零件图号 As String()) As String
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.TongBu_GongYiGongXu
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    SendRecord.Data = 零件图号
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function

    'Public Function k3_RuKuReport(SendItems As String()) As DataTable
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.k3_RuKuReport
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    SendRecord.Data = SendItems
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
    'Public Function k3_RuKuReport_new(SendItems As String()) As DataTable
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.k3_RuKuReport_new
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    SendRecord.Data = SendItems
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
    'Public Function GetURLStreamFormServer(URL As String) As String
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.GetInternetUrlResources
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    pq(Enum_URL_传入参数.URL.ToString) = URL
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
    'Public Function SetMinClientVersion(最低版本号 As String) As String
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.SetMinClientVersion
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    pq(Enum_URL_传入参数.SetMinClientVision.ToString) = 最低版本号
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
    'Public Function RTX_SendNotifyfrm(ReceiveUserNames As String, Tittle As String, DelayTime As String, Text As String, ReceiveUserIDs As String, SendFrom As String) As String
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.RTX_SendNotifyfrm
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    pq("ReceiveUserNames") = ReceiveUserNames
    '    pq("Tittle") = Tittle
    '    pq("DelayTime") = DelayTime
    '    pq("Text") = Text
    '    pq("ReceiveUserIDs") = ReceiveUserIDs
    '    pq("SendFrom") = SendFrom
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Function
    'Public Sub SendPopInfo(发起人 As String,
    '                       发起部门 As String,
    '                       发起程序 As String,
    '                       内容 As String,
    '                       标题 As String,
    '                       Optional 弹窗引擎ID As String = "0",
    '                       Optional 需要弹出的人员列表_姓名() As String = Nothing,
    '                       Optional 需要弹出的人员列表_身份证号() As String = Nothing,
    '                       Optional 弹出时间 As Date = Nothing)
    '    Dim FF As Enum_URL_调用服务器方法 = Enum_URL_调用服务器方法.SendPopInfo
    '    Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    '    pq("fqr") = 发起人
    '    pq("fqr") = 发起人
    '    pq("fqbm") = 发起部门
    '    pq("fqcx") = 发起程序
    '    pq("nr") = 内容
    '    pq("bt") = 标题
    '    pq("tcyqid") = 弹窗引擎ID
    '    If IsNothing(需要弹出的人员列表_姓名) = False Then pq("tcr") = String.Join(",", 需要弹出的人员列表_姓名)
    '    If IsNothing(需要弹出的人员列表_身份证号) = False Then pq("tcsfz") = String.Join(",", 需要弹出的人员列表_身份证号)
    '    pq("tcrq") = DCM.CaseDBNullToString(弹出时间)
    '    Dim SendRecord As New DCM_HttpListen_Record
    '    SetSendRecordCaoZuoren(SendRecord)
    '    Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
    '    DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    'End Sub
#End Region
#Region "通用接口"
    Public Function GetStringFromServer(FF As Enum_URL_调用服务器方法) As String
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        Dim SendRecord As New DCM_HttpListen_Record
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    End Function
    Public Function GetObjectFromServer(FF As Enum_URL_调用服务器方法) As Object
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        Dim SendRecord As New DCM_HttpListen_Record
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    End Function
    Public Function GetObjectFromServer(FF As Enum_URL_调用服务器方法, Data As Object) As Object
        Dim pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
        Dim SendRecord As New DCM_HttpListen_Record
        SendRecord.Data = Data
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Return DCM_Http.GetDataFromServer(FF, pq, SendRecord, ServerIP, ServerPort, YSFS)
    End Function
    ''' <summary>
    ''' pq = System.Web.HttpUtility.ParseQueryString(String.Empty)
    ''' </summary>
    ''' <param name="FF"></param>
    ''' <param name="PQ"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function GetStringFromServer(FF As Enum_URL_调用服务器方法, ByRef PQ As System.Collections.Specialized.NameValueCollection) As String
        Dim SendRecord As New DCM_HttpListen_Record
        SetSendRecordCaoZuoren(SendRecord)
        Dim YSFS As Enum_CS_数据压缩方式 = Enum_CS_数据压缩方式.序列化压缩
        Return DCM_Http.GetDataFromServer(FF, PQ, SendRecord, ServerIP, ServerPort, YSFS)
    End Function
#End Region
End Module
